﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary1;

namespace BoardNetClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("THIS IS THE CLIENT");
            NetClient myConnection = new NetClient("127.0.0.1");

            Console.WriteLine("Getting the board");
            byte[,] board = myConnection.GetBoard();
            Console.WriteLine("Print the board");
            PrintBoard(board);

            Console.WriteLine("Send a modified board");
            myConnection.SendBoard(CreateBoard());
            Console.ReadKey();
        }

        static void PrintBoard(byte[,] board)
        {
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    Console.Write(" " + board[i, j]);
                }
                Console.WriteLine();
            }
        }

        private static byte[,] CreateBoard()
        {
            byte[,] board = new byte[8,8];
            int index = 0;
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    board[i,j] += 20;
                    index++;
                }
            }
            return board;
        }
    }
}
